# test for the feed data
# write by hashaki on 2018/10/19
# build in python3.5
from hashakisea.db.feeds.getCSVData import GetCSVData
from hashakisea.db.feeds.dealTheData import PandasDataFrame
from hashakisea.engine.brokers.objectClass import barClass
file_path='/home/hashaki/pycharm-work/testKline.csv'
a=GetCSVData()
#print(a.getPandasData(file_path))    #测试有没有数据返回
#print(a.getCSVData())  # 未写好
data=a.getPandasData(file_path)

b=PandasDataFrame(data)
#print("成交量：",b.volume,"开盘价：",b.open,"最高价：",b.high,"最低价：",b.low,"收盘价：",b.close,"日期:",b.date)
bar=b.makeBar()
for i in bar:
    a=barClass()
    a.__dict__={'time':i[0],'volume':i[1],'open':i[2],'high':i[3],'low':i[4],'close':i[5]}
    print(a.__dict__)

